var resultJson = require('../result-json');
module.exports = {
    checkLogin: function checkLogin(req, res, next) {
        if (!req.session.user) {
            console.log('has no user!!!');
            return res.send(resultJson(6));
        }
        next();
    },
    checkNotLogin: function checkNotLogin(req, res, next) {
        if (req.session.user) {
            console.log('is logined!!!');
            return res.send(resultJson(0, req.session.user));
        }
        next();
    }
};